import 'package:car_map/widget/widget_agree_button.dart';
import 'package:car_map/widget/widget_realname_titlecount.dart';
import 'package:car_map/widget/widget_square_input.dart';
import 'package:flutter/material.dart';

///网络贷款黑名单
class LoanBlackListPage extends StatefulWidget {
  @override
  _loanBlackListState createState() => _loanBlackListState();
}

class _loanBlackListState extends State<LoanBlackListPage>
    with SingleTickerProviderStateMixin {
  List<Tab> tabList = [
    Tab(
      text: '主体名称',
    ),
    Tab(
      text: '主题代码',
    )
  ];

  TabController controller;

  @override
  void initState() {
    // TODO: implement initState
    super.initState();
    controller = new TabController(length: tabList.length, vsync: this);
  }

  @override
  void dispose() {
    // TODO: implement dispose
    super.dispose();
    controller.dispose();
  }

  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return Scaffold(
      appBar: AppBar(
        title: Text('网贷黑名单'),
        bottom: TabBar(
          tabs: tabList,
          controller: controller,
          onTap: (int index){
            setState(() {

            });
          },
        ),
      ),
      body: TabBarView(
        children: <Widget>[
          widgetMainBody(),
          widgetMainCode(),
        ],
        controller: controller,
      ),
    );
  }

  //主题名称
  Widget widgetMainBody(){
    return Container(
      padding: EdgeInsets.only(left: 10.0,right: 10.0),
      child: ListView(
        children: <Widget>[
          WidgetRealNameTitleCount(title: '网贷黑名单查询',contextValue: '查询贷款人是否有网贷不良记录',),
          WidgetSquareInput(title: '主体名称',hintText: '必填',textInputType: TextInputType.text,),
          WidgetAgreeButton(terms: '我同意通过互联网查询，自愿承担风险',note: '注:手机在网时长需要支付6元，谢谢',),
        ],
      ),
    );
  }

  Widget widgetMainCode(){
    return Container(
      padding: EdgeInsets.only(left: 10.0,right: 10.0),
      child: ListView(
        children: <Widget>[
          WidgetRealNameTitleCount(title: '网贷黑名单查询',contextValue: '查询贷款人是否有网贷不良记录',),
          WidgetSquareInput(title: '主体代码',hintText: '必填',textInputType: TextInputType.text,),
          WidgetAgreeButton(terms: '我同意通过互联网查询，自愿承担风险',note: '注:手机在网时长需要支付6元，谢谢',),
        ],
      ),
    );
  }
}
